<#import "PageTemplate.ftl" as p> 
<@p.page>
<div class="page-header">
  <h1 class="form-signin-heading">Please sign in</h1>
 </div>  

<p><input id="inputEmail" type="email" class="form-control" placeholder="Email address" required autofocus></input></p>
<p><input id="inputPassword" type="password" class="form-control" placeholder="Password" required></p>

<p><button id="loginButton" class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button></p>

<script>
$(document).ready(function() {
	$("#loginButton").click(function (event) {
	    event.preventDefault(); // Don't let this button submit the form
	   
	    $('.alert-error').hide(); // Hide any errors on a new submit
	
		AccountManager.login($('#inputEmail').val(), $('#inputPassword').val(), function() {
			window.location.href = '/';
		});
	});
});
</script>
</@p.page>